// 主界面
;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require(CONFIG.BasePath + "js/enterprise/base");
	var router = require("../hash/pageRouter");
	var top = require("../top/top_main");
	var footer = require("../footer/footer_main");
//	var css_main = require("./main.css");
	var css_product = require("./product.css");
	var css_common = require();
	var bulletinId;
	var databind= require("databind");
	var init = function(page) {
		bulletinId = base.getUrlParam("bulletinId");
		databind.fillInput1($("#content"), {action: "inquireBulletinDetailOwned.json?bulletinId="+bulletinId, nocode: true},fillAttachments);
		top.init(3);
		footer.init();
		router.init();
		$("#mainPage").addClass("nav_active");
		$("#head").removeClass("none");
		$("#content").removeClass("none");
		$("#footer").removeClass("none");

		initEvent();
	};

	var initEvent = function() {
	};

	var fillAttachments = function(data){
		for (var j = 0; j < data.datas[0].attachments.length; j++) {
						var row = data.datas[0].attachments;
						var txt = ['<div class="attach_list mb10" fileSrc="' + row[j].fileId + '" fileName="' + row[j].fileName + '" fileSize="' + row[j].fileSize + '">',
							'<div class="attach_logo"><img src="../../../res/images/icon/logo_attach.png"></div>',
							'<div class="attach_op">',
							'<a target="_blank" href="/finance/api/v1.0/downloadFile.file?fileUuid=' + row[j].fileId + '" download="' + row[j].fileName + '">',
							'<div class="attach_type">附件：' + row[j].fileName + '</div>',
							'<div class="attach_download">查看</div></a>',
							'<div class="hr"></div>',
						].join('');
						$(".attachments").append(txt);
					}
	}
	return {
		init: init
	};
});